package com.study.spaoplog.config;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author study
 * @version 1.0
 * @date 2020/8/18 22:33Z
 */
@Slf4j
@Data
@Component
@ConfigurationProperties(prefix = "my.thread")
public class ThreadPoolConfigProperties implements InitializingBean {
    private Integer coreSize;
    private Integer maxSize;
    private Integer keepAliveTime;

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("ThreadPoolConfigProperties.afterPropertiesSet");
        System.out.println("初始化完成");
        log.info("初始化完成:{}", coreSize);

    }
}

